<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>创建React工程 | 冲冲冲</title>
    <meta name="generator" content="VuePress 1.9.7">
    <link rel="icon" href="/wxb-blog/touXiang.jpg">
    <meta name="description" content="前端知识点整理">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    
    <link rel="preload" href="/wxb-blog/assets/css/0.styles.c4047da6.css" as="style"><link rel="preload" href="/wxb-blog/assets/js/app.8c0fb757.js" as="script"><link rel="preload" href="/wxb-blog/assets/js/4.900b5326.js" as="script"><link rel="preload" href="/wxb-blog/assets/js/1.627dfec7.js" as="script"><link rel="preload" href="/wxb-blog/assets/js/47.459c158e.js" as="script"><link rel="prefetch" href="/wxb-blog/assets/js/10.5da366e1.js"><link rel="prefetch" href="/wxb-blog/assets/js/100.6a0e9515.js"><link rel="prefetch" href="/wxb-blog/assets/js/101.0a4f1ddb.js"><link rel="prefetch" href="/wxb-blog/assets/js/102.f8294266.js"><link rel="prefetch" href="/wxb-blog/assets/js/103.7487022c.js"><link rel="prefetch" href="/wxb-blog/assets/js/104.11246d00.js"><link rel="prefetch" href="/wxb-blog/assets/js/105.f716509d.js"><link rel="prefetch" href="/wxb-blog/assets/js/106.58efb93a.js"><link rel="prefetch" href="/wxb-blog/assets/js/107.62d831d4.js"><link rel="prefetch" href="/wxb-blog/assets/js/108.583b5a2d.js"><link rel="prefetch" href="/wxb-blog/assets/js/109.1209ce30.js"><link rel="prefetch" href="/wxb-blog/assets/js/11.31bc45c0.js"><link rel="prefetch" href="/wxb-blog/assets/js/110.2269d67b.js"><link rel="prefetch" href="/wxb-blog/assets/js/111.c9798d51.js"><link rel="prefetch" href="/wxb-blog/assets/js/112.50a5b1d8.js"><link rel="prefetch" href="/wxb-blog/assets/js/113.a138b788.js"><link rel="prefetch" href="/wxb-blog/assets/js/114.30231cae.js"><link rel="prefetch" href="/wxb-blog/assets/js/115.01c0d6b9.js"><link rel="prefetch" href="/wxb-blog/assets/js/116.3b80b466.js"><link rel="prefetch" href="/wxb-blog/assets/js/117.48830aa8.js"><link rel="prefetch" href="/wxb-blog/assets/js/118.b53a6516.js"><link rel="prefetch" href="/wxb-blog/assets/js/119.271b5e67.js"><link rel="prefetch" href="/wxb-blog/assets/js/12.a84c083f.js"><link rel="prefetch" href="/wxb-blog/assets/js/120.829532de.js"><link rel="prefetch" href="/wxb-blog/assets/js/121.5e6b5cc1.js"><link rel="prefetch" href="/wxb-blog/assets/js/122.ec3253a7.js"><link rel="prefetch" href="/wxb-blog/assets/js/123.d97dcb4a.js"><link rel="prefetch" href="/wxb-blog/assets/js/124.0a2ebde2.js"><link rel="prefetch" href="/wxb-blog/assets/js/125.2325b4c3.js"><link rel="prefetch" href="/wxb-blog/assets/js/13.b0f2669d.js"><link rel="prefetch" href="/wxb-blog/assets/js/14.ec9b0c28.js"><link rel="prefetch" href="/wxb-blog/assets/js/15.73531217.js"><link rel="prefetch" href="/wxb-blog/assets/js/16.caa982f1.js"><link rel="prefetch" href="/wxb-blog/assets/js/17.a3080f70.js"><link rel="prefetch" href="/wxb-blog/assets/js/18.3ed83fbe.js"><link rel="prefetch" href="/wxb-blog/assets/js/19.c6d34143.js"><link rel="prefetch" href="/wxb-blog/assets/js/20.1dbc75a7.js"><link rel="prefetch" href="/wxb-blog/assets/js/21.0b017963.js"><link rel="prefetch" href="/wxb-blog/assets/js/22.1add63ec.js"><link rel="prefetch" href="/wxb-blog/assets/js/23.29eb7ce7.js"><link rel="prefetch" href="/wxb-blog/assets/js/24.1acc14c0.js"><link rel="prefetch" href="/wxb-blog/assets/js/25.4336e0d3.js"><link rel="prefetch" href="/wxb-blog/assets/js/26.0f25ef0b.js"><link rel="prefetch" href="/wxb-blog/assets/js/27.610e84a6.js"><link rel="prefetch" href="/wxb-blog/assets/js/28.46cdd718.js"><link rel="prefetch" href="/wxb-blog/assets/js/29.979ca3bb.js"><link rel="prefetch" href="/wxb-blog/assets/js/30.ea83a5c0.js"><link rel="prefetch" href="/wxb-blog/assets/js/31.e3e3d825.js"><link rel="prefetch" href="/wxb-blog/assets/js/32.aa79659d.js"><link rel="prefetch" href="/wxb-blog/assets/js/33.519bc533.js"><link rel="prefetch" href="/wxb-blog/assets/js/34.532535b1.js"><link rel="prefetch" href="/wxb-blog/assets/js/35.d9c1cc94.js"><link rel="prefetch" href="/wxb-blog/assets/js/36.8d328510.js"><link rel="prefetch" href="/wxb-blog/assets/js/37.c5ee763c.js"><link rel="prefetch" href="/wxb-blog/assets/js/38.33cc76ee.js"><link rel="prefetch" href="/wxb-blog/assets/js/39.7d0f943e.js"><link rel="prefetch" href="/wxb-blog/assets/js/40.67486ae5.js"><link rel="prefetch" href="/wxb-blog/assets/js/41.5c5ebfd0.js"><link rel="prefetch" href="/wxb-blog/assets/js/42.f5596c7b.js"><link rel="prefetch" href="/wxb-blog/assets/js/43.32e8db11.js"><link rel="prefetch" href="/wxb-blog/assets/js/44.3bd8001e.js"><link rel="prefetch" href="/wxb-blog/assets/js/45.65f5b1ae.js"><link rel="prefetch" href="/wxb-blog/assets/js/46.45fc8464.js"><link rel="prefetch" href="/wxb-blog/assets/js/48.a11bfe4f.js"><link rel="prefetch" href="/wxb-blog/assets/js/49.9c30d506.js"><link rel="prefetch" href="/wxb-blog/assets/js/5.fb67145f.js"><link rel="prefetch" href="/wxb-blog/assets/js/50.4e4774a6.js"><link rel="prefetch" href="/wxb-blog/assets/js/51.9a1b5ee4.js"><link rel="prefetch" href="/wxb-blog/assets/js/52.63ea264a.js"><link rel="prefetch" href="/wxb-blog/assets/js/53.84a598c3.js"><link rel="prefetch" href="/wxb-blog/assets/js/54.a4b338f0.js"><link rel="prefetch" href="/wxb-blog/assets/js/55.e8702b05.js"><link rel="prefetch" href="/wxb-blog/assets/js/56.9f6390ba.js"><link rel="prefetch" href="/wxb-blog/assets/js/57.59f004d1.js"><link rel="prefetch" href="/wxb-blog/assets/js/58.41470fa8.js"><link rel="prefetch" href="/wxb-blog/assets/js/59.b48e3490.js"><link rel="prefetch" href="/wxb-blog/assets/js/6.4c0abb46.js"><link rel="prefetch" href="/wxb-blog/assets/js/60.4c84f1b7.js"><link rel="prefetch" href="/wxb-blog/assets/js/61.ae0fe02f.js"><link rel="prefetch" href="/wxb-blog/assets/js/62.b4e4a1e6.js"><link rel="prefetch" href="/wxb-blog/assets/js/63.ec0dee52.js"><link rel="prefetch" href="/wxb-blog/assets/js/64.3d6d64aa.js"><link rel="prefetch" href="/wxb-blog/assets/js/65.c669dbe2.js"><link rel="prefetch" href="/wxb-blog/assets/js/66.47a199e3.js"><link rel="prefetch" href="/wxb-blog/assets/js/67.b96f5161.js"><link rel="prefetch" href="/wxb-blog/assets/js/68.f2917e43.js"><link rel="prefetch" href="/wxb-blog/assets/js/69.1f0baea0.js"><link rel="prefetch" href="/wxb-blog/assets/js/7.e2ab66a8.js"><link rel="prefetch" href="/wxb-blog/assets/js/70.4f25a08f.js"><link rel="prefetch" href="/wxb-blog/assets/js/71.b319631d.js"><link rel="prefetch" href="/wxb-blog/assets/js/72.e0191932.js"><link rel="prefetch" href="/wxb-blog/assets/js/73.ecb5024d.js"><link rel="prefetch" href="/wxb-blog/assets/js/74.c6e1feec.js"><link rel="prefetch" href="/wxb-blog/assets/js/75.6daefc45.js"><link rel="prefetch" href="/wxb-blog/assets/js/76.ae253459.js"><link rel="prefetch" href="/wxb-blog/assets/js/77.aeeda56a.js"><link rel="prefetch" href="/wxb-blog/assets/js/78.acbdc69b.js"><link rel="prefetch" href="/wxb-blog/assets/js/79.06ee3013.js"><link rel="prefetch" href="/wxb-blog/assets/js/8.457c5be9.js"><link rel="prefetch" href="/wxb-blog/assets/js/80.3e6d4caf.js"><link rel="prefetch" href="/wxb-blog/assets/js/81.e34252a0.js"><link rel="prefetch" href="/wxb-blog/assets/js/82.c2c5018f.js"><link rel="prefetch" href="/wxb-blog/assets/js/83.98e1596b.js"><link rel="prefetch" href="/wxb-blog/assets/js/84.ad81eee2.js"><link rel="prefetch" href="/wxb-blog/assets/js/85.b9f50159.js"><link rel="prefetch" href="/wxb-blog/assets/js/86.02892036.js"><link rel="prefetch" href="/wxb-blog/assets/js/87.46d2a524.js"><link rel="prefetch" href="/wxb-blog/assets/js/88.c4be6ad8.js"><link rel="prefetch" href="/wxb-blog/assets/js/89.6a428824.js"><link rel="prefetch" href="/wxb-blog/assets/js/9.23625e81.js"><link rel="prefetch" href="/wxb-blog/assets/js/90.56b8afcf.js"><link rel="prefetch" href="/wxb-blog/assets/js/91.362cd602.js"><link rel="prefetch" href="/wxb-blog/assets/js/92.73449f51.js"><link rel="prefetch" href="/wxb-blog/assets/js/93.4867589e.js"><link rel="prefetch" href="/wxb-blog/assets/js/94.54b5078f.js"><link rel="prefetch" href="/wxb-blog/assets/js/95.5d023adf.js"><link rel="prefetch" href="/wxb-blog/assets/js/96.35a29d7f.js"><link rel="prefetch" href="/wxb-blog/assets/js/97.3ce9e9b3.js"><link rel="prefetch" href="/wxb-blog/assets/js/98.b9799210.js"><link rel="prefetch" href="/wxb-blog/assets/js/99.4ed8d1d2.js"><link rel="prefetch" href="/wxb-blog/assets/js/vendors~flowchart.dea86b1a.js">
    <link rel="stylesheet" href="/wxb-blog/assets/css/0.styles.c4047da6.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container no-sidebar" data-v-7dd95ae2><div data-v-7dd95ae2><div class="password-shadow password-wrapper-out" style="display:none;" data-v-59e6cb88 data-v-7dd95ae2 data-v-7dd95ae2><h3 class="title" data-v-59e6cb88>冲冲冲</h3> <p class="description" data-v-59e6cb88>前端知识点整理</p> <label id="box" class="inputBox" data-v-59e6cb88><input type="password" value="" data-v-59e6cb88> <span data-v-59e6cb88>Konck! Knock!</span> <button data-v-59e6cb88>OK</button></label> <div class="footer" data-v-59e6cb88><span data-v-59e6cb88><i class="iconfont reco-theme" data-v-59e6cb88></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-59e6cb88>vuePress-theme-reco</a></span> <span data-v-59e6cb88><i class="iconfont reco-copyright" data-v-59e6cb88></i> <a data-v-59e6cb88><span data-v-59e6cb88>wxb</span>
          
        <span data-v-59e6cb88>2022 - </span>
        2023
      </a></span></div></div> <div class="hide" data-v-7dd95ae2><header class="navbar" data-v-7dd95ae2><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/wxb-blog/" class="home-link router-link-active"><img src="/wxb-blog/touXiang.jpg" alt="冲冲冲" class="logo"> <span class="site-name">冲冲冲</span></a> <div class="links"><div class="color-picker"><a class="color-button"><i class="iconfont reco-color"></i></a> <div class="color-picker-menu" style="display:none;"><div class="mode-options"><h4 class="title">Choose mode</h4> <ul class="color-mode-options"><li class="dark">dark</li><li class="auto active">auto</li><li class="light">light</li></ul></div></div></div> <div class="search-box"><i class="iconfont reco-search"></i> <input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/wxb-blog/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Css/" class="nav-link"><i class="undefined"></i>
  Css
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Docker/" class="nav-link"><i class="undefined"></i>
  Docker
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/HTML/" class="nav-link"><i class="undefined"></i>
  HTML
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Javascript/" class="nav-link"><i class="undefined"></i>
  Javascript
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/React/" class="nav-link"><i class="undefined"></i>
  React
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/uniapp项目/" class="nav-link"><i class="undefined"></i>
  uniapp项目
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Vue/" class="nav-link"><i class="undefined"></i>
  Vue
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/项目/" class="nav-link"><i class="undefined"></i>
  项目
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Vue3/" class="nav-link"><i class="undefined"></i>
  Vue3
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/插件库/" class="nav-link"><i class="undefined"></i>
  插件库
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/工具/" class="nav-link"><i class="undefined"></i>
  工具
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/开源项目/" class="nav-link"><i class="undefined"></i>
  开源项目
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/面试题/" class="nav-link"><i class="undefined"></i>
  面试题
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/面试问/" class="nav-link"><i class="undefined"></i>
  面试问
</a></li></ul></div></div><div class="nav-item"><a href="/wxb-blog/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      王xb
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://gitee.com/wxb666" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="undefined"></i>
  Gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-7dd95ae2></div> <aside class="sidebar" data-v-7dd95ae2><div class="personal-info-wrapper" data-v-1fad0c41 data-v-7dd95ae2><img src="/wxb-blog/touXiang.jpg" alt="author-avatar" class="personal-img" data-v-1fad0c41> <h3 class="name" data-v-1fad0c41>
    wxb
  </h3> <div class="num" data-v-1fad0c41><div data-v-1fad0c41><h3 data-v-1fad0c41>112</h3> <h6 data-v-1fad0c41>Articles</h6></div> <div data-v-1fad0c41><h3 data-v-1fad0c41>22</h3> <h6 data-v-1fad0c41>Tags</h6></div></div> <ul class="social-links" data-v-1fad0c41></ul> <hr data-v-1fad0c41></div> <nav class="nav-links"><div class="nav-item"><a href="/wxb-blog/" class="nav-link"><i class="iconfont reco-home"></i>
  首页
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-category"></i>
      分类
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Css/" class="nav-link"><i class="undefined"></i>
  Css
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Docker/" class="nav-link"><i class="undefined"></i>
  Docker
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/HTML/" class="nav-link"><i class="undefined"></i>
  HTML
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Javascript/" class="nav-link"><i class="undefined"></i>
  Javascript
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/React/" class="nav-link"><i class="undefined"></i>
  React
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/uniapp项目/" class="nav-link"><i class="undefined"></i>
  uniapp项目
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Vue/" class="nav-link"><i class="undefined"></i>
  Vue
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/项目/" class="nav-link"><i class="undefined"></i>
  项目
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/Vue3/" class="nav-link"><i class="undefined"></i>
  Vue3
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/插件库/" class="nav-link"><i class="undefined"></i>
  插件库
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/工具/" class="nav-link"><i class="undefined"></i>
  工具
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/开源项目/" class="nav-link"><i class="undefined"></i>
  开源项目
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/面试题/" class="nav-link"><i class="undefined"></i>
  面试题
</a></li><li class="dropdown-item"><!----> <a href="/wxb-blog/categories/面试问/" class="nav-link"><i class="undefined"></i>
  面试问
</a></li></ul></div></div><div class="nav-item"><a href="/wxb-blog/tag/" class="nav-link"><i class="iconfont reco-tag"></i>
  标签
</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title"><i class="iconfont reco-message"></i>
      王xb
    </span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://gitee.com/wxb666" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="undefined"></i>
  Gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div></div> <!----></nav> <!----> </aside> <div class="password-shadow password-wrapper-in" style="display:none;" data-v-59e6cb88 data-v-7dd95ae2><h3 class="title" data-v-59e6cb88>创建React工程</h3> <!----> <label id="box" class="inputBox" data-v-59e6cb88><input type="password" value="" data-v-59e6cb88> <span data-v-59e6cb88>Konck! Knock!</span> <button data-v-59e6cb88>OK</button></label> <div class="footer" data-v-59e6cb88><span data-v-59e6cb88><i class="iconfont reco-theme" data-v-59e6cb88></i> <a target="blank" href="https://vuepress-theme-reco.recoluan.com" data-v-59e6cb88>vuePress-theme-reco</a></span> <span data-v-59e6cb88><i class="iconfont reco-copyright" data-v-59e6cb88></i> <a data-v-59e6cb88><span data-v-59e6cb88>wxb</span>
          
        <span data-v-59e6cb88>2022 - </span>
        2023
      </a></span></div></div> <div data-v-7dd95ae2><div data-v-7dd95ae2><main class="page"><section style="display:;"><div class="page-title"><h1 class="title">创建React工程</h1> <div data-v-8a445198><i class="iconfont reco-account" data-v-8a445198><span data-v-8a445198>王xb</span></i> <i class="iconfont reco-date" data-v-8a445198><span data-v-8a445198>2/23/2022</span></i> <!----> <i class="tags iconfont reco-tag" data-v-8a445198><span class="tag-item" data-v-8a445198>React</span></i></div></div> <div class="theme-reco-content content__default"><h1 id="创建react工程"><a href="#创建react工程" class="header-anchor">#</a> 创建React工程</h1> <h2 id="初始化项目"><a href="#初始化项目" class="header-anchor">#</a> 初始化项目</h2> <div class="language- line-numbers-mode"><pre class="language-text"><code> //使用npm
 npm install -g create-react-app //第一步
 create-react-app 项目名字 //第二步
 //使用yarn
 yarn add create-react-app
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h2 id="常用依赖"><a href="#常用依赖" class="header-anchor">#</a> 常用依赖</h2> <div class="language- line-numbers-mode"><pre class="language-text"><code>//添加antd
yarn add antd
//添加axios
yarn add axios
//添加路由
yarn add react-router-dom
//添加less和lessLoader
博客：
https://juejin.cn/post/6873725957673320461
https://blog.csdn.net/weixin_49684995/article/details/120747592
yarn add less less-loader
yarn add react-app-rewired customize-cra babel-plugin-import --save-dev
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div><h3 id="react-app-rewired配置"><a href="#react-app-rewired配置" class="header-anchor">#</a> react-app-rewired配置</h3> <h2 id="配置"><a href="#配置" class="header-anchor">#</a> 配置</h2> <h3 id="导出配置"><a href="#导出配置" class="header-anchor">#</a> 导出配置：</h3> <p>指令：npm run eject</p> <p>此命令会把 <code>react-scripts</code> 封装的一些webpack配置等全部解压到项目目录，项目结构中会多出 <strong>config</strong> 目录 和 <strong>scripts</strong> 目录</p> <h3 id="src配置别名"><a href="#src配置别名" class="header-anchor">#</a> src配置别名</h3> <p>​	在npm run eject基础上</p> <p>​	在<code>config/webpack.config.js</code>文件的<code>alias</code>中插入代码</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token literal-property property">alias</span><span class="token operator">:</span> <span class="token punctuation">{</span>
  	<span class="token comment">// Support React Native Web</span>
   	<span class="token comment">// https://www.smashingmagazine.com/2016/08/a-glimpse-into-		the-future-with-react-native-for-web/</span>
  	<span class="token operator">...</span><span class="token operator">...</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
   	<span class="token string-property property">'@'</span><span class="token operator">:</span> path<span class="token punctuation">.</span><span class="token function">resolve</span><span class="token punctuation">(</span><span class="token string">'src'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><h3 id="修改启动端口号"><a href="#修改启动端口号" class="header-anchor">#</a> 修改启动端口号</h3> <h5 id="第一种"><a href="#第一种" class="header-anchor">#</a> 第一种</h5> <p>package.json中：在“scripts”的“start”原来部分之前加上&quot;set PORT=XXXX &amp;&amp; &quot;</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>&quot;scripts&quot;: {
    &quot;start&quot;: &quot;set PORT= 7777 &amp;&amp; react-scripts start&quot;,
    &quot;build&quot;: &quot;react-scripts build&quot;,
    &quot;test&quot;: &quot;react-scripts test&quot;,
    &quot;eject&quot;: &quot;react-scripts eject&quot;
},
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><h5 id="第二种"><a href="#第二种" class="header-anchor">#</a> 第二种</h5> <p><strong>使用react-app-rewired会导致该配置失效</strong></p> <p>npm run eject后生成的scripts/start.js下搜3000，修改端口号。</p> <h3 id="添加less"><a href="#添加less" class="header-anchor">#</a> 添加less</h3> <p>修改config/webpack.config.js文件</p> <h5 id="第一处"><a href="#第一处" class="header-anchor">#</a> 第一处</h5> <img src="http://wxb1997.oss-cn-beijing.aliyuncs.com/img/image-20221219132629999.png" alt="image-20221219132629999" style="zoom:33%;"> <div class="language- line-numbers-mode"><pre class="language-text"><code>// less配置 ①
const lessRegex = /\.less$/;
const lessModuleRegex = /\.module\.less$/;
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h5 id="第二处"><a href="#第二处" class="header-anchor">#</a> 第二处</h5> <p>复制sass配置，然后吧sass文字部分替换成less</p> <img src="http://wxb1997.oss-cn-beijing.aliyuncs.com/img/image-20221219132847512.png" alt="image-20221219132847512" style="zoom:33%;"> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token comment">// less配置 ②</span>
<span class="token punctuation">{</span>
    <span class="token literal-property property">test</span><span class="token operator">:</span> lessRegex<span class="token punctuation">,</span>
    <span class="token literal-property property">exclude</span><span class="token operator">:</span> lessModuleRegex<span class="token punctuation">,</span>
    <span class="token literal-property property">use</span><span class="token operator">:</span> <span class="token function">getStyleLoaders</span><span class="token punctuation">(</span>
    <span class="token punctuation">{</span>
    <span class="token literal-property property">importLoaders</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>
    <span class="token literal-property property">sourceMap</span><span class="token operator">:</span> isEnvProduction <span class="token operator">&amp;&amp;</span> shouldUseSourceMap<span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token string">'less-loader'</span>
    <span class="token punctuation">)</span><span class="token punctuation">,</span>
    <span class="token comment">// Don't consider CSS imports dead code even if the</span>
    <span class="token comment">// containing package claims to have no side effects.</span>
    <span class="token comment">// Remove this when webpack adds a warning or an error for this.</span>
    <span class="token comment">// See https://github.com/webpack/webpack/issues/6571</span>
    <span class="token literal-property property">sideEffects</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token comment">// Adds support for CSS Modules, but using SASS</span>
<span class="token comment">// using the extension .module.scss or .module.sass</span>
<span class="token punctuation">{</span>
    <span class="token literal-property property">test</span><span class="token operator">:</span> lessModuleRegex<span class="token punctuation">,</span>
    <span class="token literal-property property">use</span><span class="token operator">:</span> <span class="token function">getStyleLoaders</span><span class="token punctuation">(</span>
    <span class="token punctuation">{</span>
        <span class="token literal-property property">importLoaders</span><span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>
        <span class="token literal-property property">sourceMap</span><span class="token operator">:</span> isEnvProduction <span class="token operator">&amp;&amp;</span> shouldUseSourceMap<span class="token punctuation">,</span>
        <span class="token literal-property property">modules</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        	<span class="token literal-property property">getLocalIdent</span><span class="token operator">:</span> getCSSModuleLocalIdent<span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    	<span class="token string">'less-loader'</span>
    <span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br></div></div><h3 id="添加antd"><a href="#添加antd" class="header-anchor">#</a> 添加antd</h3> <h5 id="第一步-添加-babel-plugin-import"><a href="#第一步-添加-babel-plugin-import" class="header-anchor">#</a> 第一步：添加 babel-plugin-import</h5> <div class="language- line-numbers-mode"><pre class="language-text"><code>yarn add babel-plugin-import
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h5 id="第二步-配置package-json文件"><a href="#第二步-配置package-json文件" class="header-anchor">#</a> 第二步：配置package.json文件</h5> <img src="C:\Users\underfind\AppData\Roaming\Typora\typora-user-images\image-20221219143250400.png" alt="image-20221219143250400" style="zoom:33%;"> <div class="language- line-numbers-mode"><pre class="language-text"><code>&quot;plugins&quot;:[
      [&quot;import&quot;,{&quot;libraryName&quot;:&quot;antd&quot;,&quot;style&quot;:true}]
]
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h5 id="第三步-修改config-webpack-config-js文件配置"><a href="#第三步-修改config-webpack-config-js文件配置" class="header-anchor">#</a> 第三步：修改config/webpack.config.js文件配置</h5> <img src="http://wxb1997.oss-cn-beijing.aliyuncs.com/img/image-20221219143951819.png" alt="image-20221219143951819" style="zoom:33%;"> <p>做完上面步骤后运行会报错</p> <p>解决方法：</p> <img src="http://wxb1997.oss-cn-beijing.aliyuncs.com/img/image-20221219144233281.png" alt="image-20221219144233281" style="zoom:33%;"> <div class="language- line-numbers-mode"><pre class="language-text"><code> // antd 配置 不然会报错
 javascriptEnabled: true,
 modifyVars: { &quot;@primary-color&quot;: &quot;#1DA57A&quot; },
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h3 id="配置proxy代理"><a href="#配置proxy代理" class="header-anchor">#</a> 配置proxy代理</h3> <p>新建<code>setupProxy.js</code>（必须是这个名字，<a href="https://so.csdn.net/so/search?q=react&amp;spm=1001.2101.3001.7020" target="_blank" rel="noopener noreferrer">react<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>脚手架会识别）</p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">const</span> createProxyMiddleware  <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'http-proxy-middleware'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> target <span class="token operator">=</span> <span class="token string">'http://smart.hyjtyl.com'</span><span class="token comment">//线上地址</span>
module<span class="token punctuation">.</span><span class="token function-variable function">exports</span> <span class="token operator">=</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">app</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    app<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>
        <span class="token function">createProxyMiddleware</span><span class="token punctuation">(</span><span class="token string">'/engineering'</span><span class="token punctuation">,</span><span class="token punctuation">{</span> <span class="token comment">//遇见/api1前缀的请求，就会触发该代理配置</span>
            target<span class="token punctuation">,</span> <span class="token comment">//请求转发给谁</span>
            <span class="token literal-property property">changeOrigin</span><span class="token operator">:</span><span class="token boolean">true</span><span class="token punctuation">,</span><span class="token comment">//控制服务器收到的请求头中Host的值</span>
            <span class="token literal-property property">pathRewrite</span><span class="token operator">:</span><span class="token punctuation">{</span><span class="token string-property property">'^/engineering'</span><span class="token operator">:</span><span class="token string">'engineering'</span><span class="token punctuation">}</span> <span class="token comment">//重写请求路径，下面有示例解释</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token comment">// proxy.createProxyMiddleware('/api2',{</span>
        <span class="token comment">//     target,</span>
        <span class="token comment">//     changeOrigin:true,</span>
        <span class="token comment">//     pathRewrite:{'^/api2':''}</span>
        <span class="token comment">// }),</span>
    <span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br></div></div><h3 id="启动项目不打开浏览器"><a href="#启动项目不打开浏览器" class="header-anchor">#</a> 启动项目不打开浏览器</h3> <p>找到package.json 文件
修改 node scripts/start.js 为  set BROWSER=none &amp;&amp; node scripts/start.js，这样每次启动项目就不会打开浏览器了</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>&quot;scripts&quot;: {
    &quot;start&quot;: &quot;set BROWSER=none &amp;&amp; node scripts/start.js&quot;,
    &quot;build&quot;: &quot;node scripts/build.js&quot;,
    &quot;test&quot;: &quot;node scripts/test.js&quot;
  },
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h2 id="报错"><a href="#报错" class="header-anchor">#</a> 报错</h2> <h5 id="一、使用了react-app-rewired后再npm-run-eject项目跑不起来"><a href="#一、使用了react-app-rewired后再npm-run-eject项目跑不起来" class="header-anchor">#</a> 一、使用了react-app-rewired后再npm run eject项目跑不起来</h5> <p><strong>解决</strong>：执行了npm run eject 暴露了配置文件，使得react-app-rewired包找不到react-scripts。你也可以直接 npm install react-scripts -D，但这样会存在另一个问题，会造成你由npm run eject检出config目录下更改一些配置无效。</p> <h2 id="疑问"><a href="#疑问" class="header-anchor">#</a> 疑问</h2> <h4 id="一、为啥不建议执行eject"><a href="#一、为啥不建议执行eject" class="header-anchor">#</a> 一、为啥不建议执行eject</h4> <p>博客：https://www.misuland.com/news/5184781646674533920</p> <h5 id="_1-执行eject产生了什么变化"><a href="#_1-执行eject产生了什么变化" class="header-anchor">#</a> 1. 执行eject产生了什么变化？</h5> <p><code>create-react-app</code>框架本身将<code>webpack</code>、<code>babel</code>的相关配置封装在了<code>react-scripts</code>中， 执行<code>yarn eject</code>后，会将<code>webpack</code>、<code>babel</code>等配置暴露在<code>config</code>目录下，同时<code>scripts</code>目录下会有新的命令文件更新，<code>package.json</code>文件中<code>scripts</code>命令同步更新。</p> <h5 id="_2-执行eject带来了什么问题"><a href="#_2-执行eject带来了什么问题" class="header-anchor">#</a> 2. 执行eject带来了什么问题？</h5> <p>首先，执行eject是<a href="http://msd.misuland.com/pd/5184781577955051132" target="_blank" rel="noopener noreferrer">不可逆<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>的，复杂的webpack等配置由框架本身转交给用户自己进行维护了。</p> <p>其次，在版本迭代时，如果更新了<code>react</code>、<code>react-scripts</code>、<code>eslint</code>、<code>tsconfig</code>等依赖，有可能会引起版本依赖的问题，<strong>即使我们按错误信息修复了之后，项目还是无法运行</strong>。</p> <blockquote><p>所以我们一般不太建议使用<code>yarn eject</code>的方式暴露<code>create-react-app</code>框架的配置。</p></blockquote></div></section> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/30/2022, 10:51:14 AM</span></div></footer> <!----> <div class="comments-wrapper"><!----></div></main></div> <!----></div> <ul class="sub-sidebar sub-sidebar-wrapper" style="width:12rem;" data-v-b57cc07c data-v-7dd95ae2><li class="level-2" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#初始化项目" class="sidebar-link reco-side-初始化项目" data-v-b57cc07c>初始化项目</a></li><li class="level-2" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#常用依赖" class="sidebar-link reco-side-常用依赖" data-v-b57cc07c>常用依赖</a></li><li class="level-3" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#react-app-rewired配置" class="sidebar-link reco-side-react-app-rewired配置" data-v-b57cc07c>react-app-rewired配置</a></li><li class="level-2" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#配置" class="sidebar-link reco-side-配置" data-v-b57cc07c>配置</a></li><li class="level-3" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#导出配置" class="sidebar-link reco-side-导出配置" data-v-b57cc07c>导出配置：</a></li><li class="level-3" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#src配置别名" class="sidebar-link reco-side-src配置别名" data-v-b57cc07c>src配置别名</a></li><li class="level-3" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#修改启动端口号" class="sidebar-link reco-side-修改启动端口号" data-v-b57cc07c>修改启动端口号</a></li><li class="level-3" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#添加less" class="sidebar-link reco-side-添加less" data-v-b57cc07c>添加less</a></li><li class="level-3" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#添加antd" class="sidebar-link reco-side-添加antd" data-v-b57cc07c>添加antd</a></li><li class="level-3" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#配置proxy代理" class="sidebar-link reco-side-配置proxy代理" data-v-b57cc07c>配置proxy代理</a></li><li class="level-3" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#启动项目不打开浏览器" class="sidebar-link reco-side-启动项目不打开浏览器" data-v-b57cc07c>启动项目不打开浏览器</a></li><li class="level-2" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#报错" class="sidebar-link reco-side-报错" data-v-b57cc07c>报错</a></li><li class="level-2" data-v-b57cc07c><a href="/wxb-blog/views/%E6%8A%80%E6%9C%AF/React/%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91/%E5%88%9B%E5%BB%BAReact%E5%B7%A5%E7%A8%8B.html#疑问" class="sidebar-link reco-side-疑问" data-v-b57cc07c>疑问</a></li></ul></div></div></div><div class="global-ui"><div class="back-to-ceiling" style="right:1rem;bottom:6rem;width:2.5rem;height:2.5rem;border-radius:.25rem;line-height:2.5rem;display:none;" data-v-c6073ba8 data-v-c6073ba8><svg t="1574745035067" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5404" class="icon" data-v-c6073ba8><path d="M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z" p-id="5405" data-v-c6073ba8></path><path d="M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z" p-id="5406" data-v-c6073ba8></path></svg></div></div></div>
    <script src="/wxb-blog/assets/js/app.8c0fb757.js" defer></script><script src="/wxb-blog/assets/js/4.900b5326.js" defer></script><script src="/wxb-blog/assets/js/1.627dfec7.js" defer></script><script src="/wxb-blog/assets/js/47.459c158e.js" defer></script>
  </body>
</html>
